const fs = require('fs');
const zlib = require('zlib');

let rs = fs.createReadStream('jquery.js');
let ws = fs.createWriteStream('jquery.gz');
let gz = zlib.createGzip();

rs.pipe(gz).pipe(ws);

ws.on('finish',()=>{
  console.log('完成');
});
